
#include"taskQeuen.h"
//Init List
int initList(netList_t *netList)
{
    bzero(netList,sizeof(netList));
    return 0;
}
// Add netfd
int addTail(netList_t *netList,int netfd)
{
    node_t *pnetfd = (node_t*)calloc(1,sizeof(node_t));
    pnetfd->netfd = netfd;
    pnetfd->pNetfd = NULL;
    if(netList->length == 0)
    {
        netList->pTail = pnetfd;
        netList->pThead = pnetfd;
    }
    else{
        netList->pTail->pNetfd = pnetfd;
        netList->pTail = pnetfd;
    }
    netList->length++;
    return 0;
}
//delete netfd
int deleHead(netList_t *netList)
{
    node_t *pcur = netList->pThead;
    netList->pThead = pcur->pNetfd;
    if(netList->length == 1)
    {
        netList->pTail == NULL;
    }
    free(pcur);
    netList->length--;
    return 0;
}